package com.itheima04;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Test03 {
    public static void main(String[] args) {
        ArrayList<String> s1 = new ArrayList<>();
        s1.add("黄药师");
        s1.add("冯蘅");
        s1.add("郭靖");
        s1.add("黄蓉");
        s1.add("郭芙");
        s1.add("郭襄");
        s1.add("郭破虏");
        Stream<String> sm = s1.stream();
        Stream<String> sm1 = sm.skip(2);

        ArrayList<String> s2 = new ArrayList<>();
        s2.add("陈玄风");
        s2.add("梅超风");
        s2.add("陆乘风");
        s2.add("曲灵风");
        s2.add("武眠风");
        s2.add("冯默风");
        s2.add("罗玉风");
        Stream<String> s3 = s2.stream();
        Stream<String> sm2 = s3.limit(4);

        Stream<String> concat = Stream.concat(sm1, sm2);
        List<String> collect = concat.filter(s -> s.length() == 3).collect(Collectors.toList());
        collect.forEach(s -> System.out.println(s));

    }
}
